home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 06 - 1990 / 06.12 Dec 90 / NeXT for Mac Code / RocketView.h < prev    next >
Encoding:
Text File  |  1990-03-26  |  1.5 KB  |  52 lines  |  [TEXT/QED1]

  1. /* FILE = RocketView.h */
  2.  
  3. #import <appkit/appkit.h>
  4.  
  5. #define MAXMISSLES 5
  6.  
  7. @interface  RocketView : View     
  8. /* subclass of view */
  9. {    
  10.     /* all instance variables are private by default. */
  11.  
  12.     NXPoint        misslePositions[MAXMISSLES];
  13.     BOOL        misslesLaunched;
  14.     int        numRockets;
  15.  
  16.     /* we could have created an array of missle objects instead of this array, 
  17.     and allowed more flexibility in modifying this program later... */
  18.  
  19.     id        BlaunchRockets; 
  20.     /* launch rocket button */
  21.  
  22.     id        IFnumberRockets; 
  23.     /* input text field = a Form object */
  24. }
  25.  
  26. + newFrame: (const NXRect *) frameRect;
  27.     /* override View's default newFrame method */
  28.  
  29. - updatedrawing;
  30.     /* draws the missles in the view */
  31.  
  32. - drawSelf: (const NXRect *) rects : (int) rectCount;
  33.     /* override View's default drawing method -- we don't call this directly.  
  34.     drawSelf:: gets called when the window/view objects are first displayed, and 
  35.     at certain other times, such as in response to the printPScode: message.  By 
  36.     properly defining this routine, the program can automatically support 
  37.     printing as well as displaying -- so long as you don't use certain Display 
  38.     PostScript extensions, such as compositing bitmaps! */
  39.  
  40. - setBlaunchRockers:anObject;
  41.     /* created by interface builder */
  42.     
  43. - setIFnumberRockets:anObject;
  44.     /* created by interface builder */
  45.     
  46. - rocketlaunch:sender;
  47.     /* in this program, this sender will always be the button named "Launch 
  48.     Rockets" and this routine will be called when the user clicks in this button 
  49.     object during execution of this program */
  50.  
  51. @end
  52.